/*jadclipse*/// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.

package org.zty.common;

import java.sql.SQLException;
import java.util.UUID;

import org.zty.util.ZException;

import com.ibatis.sqlmap.client.SqlMapClient;

// Referenced classes of package com.mit.service:
//            SeqService

public class BaseService {

	public BaseService() {
		nameSpace = "";
	}

	protected void startTransaction(SqlMapClient client) throws ZException {
		try {
			client.startTransaction();
		} catch (SQLException e) {
			throw new ZException("启动事务失败", e);
		}
	}

	protected void commitTransaction(SqlMapClient client) throws SQLException {
		try {
			client.commitTransaction();
		} catch (SQLException e) {
			throw e;
		}
	}

	protected void endTransaction(SqlMapClient client) {
		try {
			client.endTransaction();
		} catch (SQLException sqlexception) {
		}
	}

	public int getNextId(String name) throws ZException {
		SeqService ss = new SeqService(client);
		return ss.getNextId(name);
	}
	public String getUuid(){
		return UUID.randomUUID().toString();
	}
	protected void checkNull(Object o) throws ZException {
		if (o == null)
			throw new ZException("操作对象不能为null");
		else
			return;
	}

	protected SqlMapClient client;
	protected String nameSpace;
}

